﻿using FoodModel;
using J.FoodManageGet.Application.Command.SpecificationCommand;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageGet.Application.CommandHandler.SpecificationCommandHandler
{
    public class SpecificationCommandHandler : IRequestHandler<SpecificationCommand, List<SpecificationModel>>
    {
        private readonly ISpecificationRepository _specificationRepository;

        public SpecificationCommandHandler(ISpecificationRepository specificationRepository)
        {
            _specificationRepository = specificationRepository;
        }
        public async Task<List<SpecificationModel>> Handle(SpecificationCommand request, CancellationToken cancellationToken)
        {
            var list = await _specificationRepository.SpecificationShow();
            return list;
        }
    }
}
